<form nz-form [formGroup]="f" [nzLayout]="'vertical'">
  <nz-form-item>
    <nz-form-control nzErrorTip="必须输入项">
      <nz-input-group [nzSuffix]="suffixTemplate">
        <input
          autocomplete="off"
          formControlName="password"
          [type]="passwordVisible ? 'text' : 'password'"
          nz-input
          placeholder="请输入锁屏密码"
          required
        />
      </nz-input-group>
      <ng-template #suffixTemplate>
        <i
          nz-icon
          [nzType]="!passwordVisible ? 'eye-invisible' : 'eye'"
          (click)="passwordVisible = !passwordVisible"
        ></i>
      </ng-template>
    </nz-form-control>
  </nz-form-item>
</form>
